package com.qidianit.check.config;

import com.qidianit.check.login.CheckLoginInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author 戴着假发的程序员
 * @company 起点编程
 * @date 2025/8/7 10:08
 * @description
 */
@Configuration
public class MyWebMvcConfig implements WebMvcConfigurer {
    //  我们可以通过配置将我们要拦截的路径写在配置文件中，然后通过@Value注解获取
//    @Value("${check.login.excludePaths}")
//    private String excludePaths;

    @Autowired
    private CheckLoginInterceptor checkLoginInterceptor;
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(checkLoginInterceptor).addPathPatterns("/**");
    }
}
